<template>
  <div class="state-item">
    <div class="state-item-content">
      <span
        :style="{background: `linear-gradient(45deg, transparent 30px, ${bg} 0) right`}"
        class="state-title">
        {{ title }}
      </span>
    </div>
    <slot name="info"/>
  </div>
</template>

<script>
export default {
  name: 'BevelBox',
  props: {
    title: {
      type: String | Number,
      default: ''
    },
    bg: {
      type: String,
      default: '#1AD175'
    }
  }
}
</script>

<style lang="scss" scoped>
  .state-item{
    min-width: 120px;
    height: 60px;
    border: 1px solid #ccc;
    margin: 0 20px 10px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background-color: #fafafa;
    .state-item-content{
      width: 100%;
      display: flex;
      justify-content: flex-end;
      .state-title{
        position: relative;
        display: block;
        min-width: 100px;
        height: 30px;
        color: #fff;
        text-align: center;
        line-height: 30px;
        font-size: 14px;
        padding-left: 30px;
      }
      .state-title::before {
        position: absolute;
        top: 0;
        left: 0;
        content: '';
        width: 1px;
        height: 30px;
        background-color: #fafafa;
      }
    }
  }
</style>
